package com.example.login.api

import com.example.login.model.LoginBean
import com.example.login.model.RegisterBean
import com.example.repo.BaseResp
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.GET
import retrofit2.http.POST
import java.util.Objects

interface LoginApi {
    @FormUrlEncoded
    @POST("user/login")
    suspend fun login(@Field("username")username:String,
                      @Field("password")password:String): BaseResp<LoginBean>

    @FormUrlEncoded
    @POST("user/register")
    suspend fun register(@Field("username")username:String,
                           @Field("password")password:String,
                         @Field("repassword")repassword:String):BaseResp<RegisterBean>


    @GET
    suspend fun exituser()
}